#pragma once
#include <thread>
#include <functional>
#include <memory>
#include <string>

class ThreadFactory {
public:
    virtual ~ThreadFactory() = default;
    virtual std::thread createThread(std::function<void()> task) = 0;
};

class DefaultThreadFactory : public ThreadFactory {
public:
    explicit DefaultThreadFactory(const std::string& prefix = "Worker-", bool daemon = false);
    std::thread createThread(std::function<void()> task) override;

private:
    std::string prefix_;
    bool daemon_;
};

